package com.buss.admin.controller;

import java.io.IOException;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.multipart.MultipartFile;

import com.buss.common.service.impl.FileService;

/**
 * 用户文件相关操作
 * 
 * @author 荆志宝
 *
 */

@Controller
@RequestMapping("/userFile")
public class UserFileController {

	@Autowired
	private FileService fileUploadService;

	@RequestMapping(value = "upload", method = RequestMethod.POST)
	@ResponseBody
	public Map upload(MultipartFile fileToUpload) throws IOException {

		Map result = fileUploadService.uploadFile(fileToUpload);

		return result;

	}

}
